home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / graphics / 3dvect30.arj / VARS1.INC < prev    next >
Text File  |  1993-11-18  |  13KB  |  363 lines

  1. ; main variable tables
  2.  
  3.            align 16
  4.  
  5. ; table of current limitations/restraints - to be used as reference by  user
  6. ; at run-time to determine if object code has been assembled with ample room
  7. ; for data/variables/point/surfaces etc...
  8.  
  9. asm_maxpoints      dw maxpoints
  10. asm_maxsurfaces    dw maxsurfaces
  11. asm_maxpolys       dw maxpolys
  12. asm_maxobjects     dw maxobjects
  13. asm_number_spaces  dw number_of_spaces
  14. asm_xsize          dw xmax-xmin
  15. asm_ysize          dw ymax-ymin
  16. asm_usez           dw usez
  17. asm_useborders     dw useborders
  18. asm_use_half_stars dw use_half_stars
  19. asm_cameraobject   dw cameraobject
  20. asm_xmode          dw xmode
  21. asm_ratiox         dw ratiox
  22. asm_ratioy         dw ratioy
  23. asm_xactual        dw xactual
  24. asm_yactual        dw yactual
  25. asm_pages          dw pages
  26.  
  27.            align 16
  28.  
  29. x1         dw ?                     ; points for line draw
  30. y1         dw ?
  31. x2         dw ?
  32. y2         dw ?
  33. rise       dw ?                     ; counter for draw loop
  34. xp         dw maxpoints dup (?)     ; points breakdown, after rotated, 2d,
  35. yp         dw maxpoints dup (?)     ; x,y points after 3d, are actual location.
  36. zp         dw maxpoints dup (?)     ; z useless, only good during sort of sides
  37. sides      dw maxsurfaces*maxpolys dup (?) ; visible sides only here (clockwize)
  38. order      dw maxsurfaces dup (?)   ; what order to draw surfaces in.
  39. zeds       dw maxsurfaces dup (?)   ; z values of first point in side, for sort
  40. surfcolors dw maxsurfaces dup (?)   ; colours for those sides, high and low
  41. colors12   dd 0                     ; colours for sides 1&2
  42. textures   dw maxsurfaces dup (?)   ; commands/textures for sides
  43. texture12  dd 0                     ; textures for sides 1&2
  44. command    dw 0                     ; current command in load_surfaces loop
  45. showing    dw 0                     ; how many visible sides (total)
  46. pointindex dw 0                     ; indexer to points, xs[],ys[],zs[]
  47.  
  48.  
  49. numsides   dw ?                     ; number of sides total, gets trashed
  50. numpoints  dw ?                     ; number of points, gets trashed
  51. whichside  dw ?                     ; which side am i doing now
  52. firstbyte  dw ymax-ymin dup(1000)   ; table of start and end x points
  53.            dw 1000                  ; end flag, permanent
  54. lastbyte   dw ymax-ymin dup(-1000)
  55. oney       dw 1000                  ; y start for one polygon draw
  56. colq       db ?                     ; colour of this side
  57. lamflag    db ?                     ; is lambert matrix set up for this object?
  58.            align 16
  59. currobj    dd ?                     ; current object number (for shading)
  60. xupdate    dw xmax,xmin-1           ; x,y update for clearing entire picture
  61. yupdate    dw ymax,ymin-1
  62. lxupdate   dw xmax,xmin-1           ; last x,y update
  63. lyupdate   dw ymax,ymin-1
  64. xad        dd ?
  65. yad        dd ?
  66. zad        dd ?
  67. vxcos      dd ?
  68. vxsin      dd ?
  69. vycos      dd ?
  70. vysin      dd ?
  71. vzcos      dd ?
  72. vzsin      dd ?
  73. steel      db ?                     ; steel flag, -1 = don't use
  74. steelc     db ?                     ; base colour for steel, taken from colq
  75. dsq        dw ?                     ; for checkfront routine
  76. esq        dw ?
  77.  
  78. ; variables for multiple object routine, you modify these!
  79. ;
  80. ; userotate object commands
  81. ;
  82. ; 0  = all rotations supported - full object
  83. ;
  84. ; 1  = camera rotations only - no compound, new loadpoints
  85. ;
  86. ;      object is same as when userotate=0 but will not allow any object specific
  87. ;      rotations.  this is used to speed up rendering of objects that are
  88. ;      stationary or objects that will always be pointing in the same direction.
  89. ;      make1obj routine then assumes angles = 0x, 0y, 0z
  90. ;
  91. ; 32 = bitmap - no compound, no loadpoints, no sort and no drawvect
  92. ; 33 = bitmap, 1/4 scale, faster than 32
  93. ;
  94. ;      if object is bitmap, then:
  95. ;
  96. ;      whatshape - indexer to which bitmap in bitbase list
  97. ;      xs,ys,zs  - point to bitmap location in space
  98. ;      vxs       - bitmap scaling (how big is bitmap).  note: bitmap is already
  99. ;                  scaled based on distance so you don't have to change this
  100. ;                  as the bitmap gets farther away.
  101. ;
  102. ; 64 = point - no compound, no loadpoints, no sort and no drawvect
  103. ;
  104. ;      used for bullets.  could be used for stars but if you do want to make
  105. ;      stars, make a specialized bitmap routine.  making stars as objects would
  106. ;      be too slow.  right now, bullets all have same colour, see constant in
  107. ;      equ.inc.  note:sept 29/93, stars routines now are a seperate specialized
  108. ;                     assembley routine. - stars.asm
  109. ;
  110. ;      xs,ys,zs  - point to bullet location in space
  111.  
  112.            align 16
  113. xs         dd maxobjects+1 dup (?)  ; locations of objects
  114. ys         dd maxobjects+1 dup (?)
  115. zs         dd maxobjects+1 dup (?)
  116. xadds      dd maxobjects+1 dup (?)  ; linear velocities of objects
  117. yadds      dd maxobjects+1 dup (?)
  118. zadds      dd maxobjects+1 dup (?)
  119. vxs        dw maxobjects+1 dup (?)  ; angles of objects
  120. vys        dw maxobjects+1 dup (?)
  121. vzs        dw maxobjects+1 dup (?)
  122. vxadds     dw maxobjects+1 dup (?)  ; anglular velocities
  123. vyadds     dw maxobjects+1 dup (?)
  124. vzadds     dw maxobjects+1 dup (?)
  125. lcount     dw maxobjects+1 dup (0)  ; linear counter
  126. acount     dw maxobjects+1 dup (0)  ; angular counter
  127. xsfinal    dd maxobjects+1 dup (?)  ; final locations of objects
  128. ysfinal    dd maxobjects+1 dup (?)
  129. zsfinal    dd maxobjects+1 dup (?)
  130. vxsfinal   dw maxobjects+1 dup (?)  ; final angles of objects
  131. vysfinal   dw maxobjects+1 dup (?)
  132. vzsfinal   dw maxobjects+1 dup (?)
  133. whatshape  dw maxobjects+1 dup (?)  ; shapes of objects or bitmaps (0,1,2...)
  134. palxref    dd maxobjects+1 dup (offset nullpalette) ; palette cross reference for each object
  135. userotate  db maxobjects+1 dup (?)  ; rotation type,0 = full,1 = camera
  136.            align 16
  137. onoff      db maxobjects+1 dup (0)  ; is object on/off
  138.  
  139. ; temp strorage for object routine
  140.  
  141.            align 16
  142. finalzed   dw maxobjects dup (?)  ; final z for sort routine
  143. makeorder  dw maxobjects dup (?)  ; order for objects, bubble sorted
  144. zedthis    dw ?                   ; final z temp
  145.  
  146. ; flags to disable/enable routines: disable = -1, enable >=0
  147.  
  148. use_clear  dw yes                 ; flag to use clear_fill routine, default=use
  149. wfollow    dw no                  ; what object are we following, -1 = none
  150. wherelook  dw no                  ; what object do we force camera to look at
  151.  
  152. oldspeed   dw ?                   ; how fast to move, temp counter
  153.  
  154. ; camera variables = was last object in object list, now is zero'th
  155.  
  156. eyex       equ d [xs+cameraobject*4] ; camera location
  157. eyey       equ d [ys+cameraobject*4]
  158. eyez       equ d [zs+cameraobject*4]
  159. eyeax      equ w [vxs+cameraobject*2] ; angles for camera
  160. eyeay      equ w [vys+cameraobject*2]
  161. eyeaz      equ w [vzs+cameraobject*2]
  162. eyexadds   equ d [xadds+cameraobject*4] ; eye location velocity
  163. eyeyadds   equ d [yadds+cameraobject*4]
  164. eyezadds   equ d [zadds+cameraobject*4]
  165. eyevxadds  equ w [vxadds+cameraobject*2] ; eye angular velocities
  166. eyevyadds  equ w [vyadds+cameraobject*2]
  167. eyevzadds  equ w [vzadds+cameraobject*2]
  168. eyelcount  equ w [lcount+cameraobject*2] ; eye linear count (how many times to move)
  169. eyeacount  equ w [acount+cameraobject*2] ; eye angular count
  170. eyefinalx  equ d [xsfinal+cameraobject*4] ; final camera position
  171. eyefinaly  equ d [ysfinal+cameraobject*4]
  172. eyefinalz  equ d [zsfinal+cameraobject*4]
  173. eyefinalax equ w [vxsfinal+cameraobject*2] ; final camera angle
  174. eyefinalay equ w [vysfinal+cameraobject*2]
  175. eyefinalaz equ w [vzsfinal+cameraobject*2]
  176.  
  177.            align 16
  178.  
  179. ecosx      dd ?              ; multipliers of eyeax and eyeaz
  180. esinx      dd ?              ; reset at begining of each new frame
  181. ecosy      dd ?
  182. esiny      dd ?
  183. ecosz      dd ?
  184. esinz      dd ?
  185.  
  186. vcosx      dw ?              ; temp storage for object matrix calculation
  187. vsinx      dw ?              ; can be used if needed during draw
  188. vcosy      dw ?
  189. vsiny      dw ?
  190. vcosz      dw ?
  191. vsinz      dw ?
  192.  
  193. vmatrix    dw 9 dup (?)      ; 3x3 rotation matrix for object (includes eye)
  194. tmatrix    dw 9 dup (?)      ; 3x3 temp rotation matrix for hierarchys
  195. ematrix    dd 9 dup (?)      ; 3x3 rotation matrix for eye (32 bit)
  196. lmatrix    dw 3 dup (?)      ; 1x3 z resultant matrix for lambert shading
  197.  
  198. y_angle_of_sun dw 2000h      ; where is the sun? for shading
  199.  
  200. ; clipping variables in memory locations, pre-calculated!
  201. ; xactual and yactual basically don't change but clipping can to allow
  202. ; windows (rear view mirror, view airplanes menu, auxilary views, rear gunner)
  203. ;
  204. ; when flipping between windows, also flip makeorder[], wfollow, wherelook
  205. ; oldspeed, lxupdate, lyupdate, camera variables/angles/speeds (obviously).
  206.  
  207. cliplt      dw xcenter+xmin     ; xcenter+xmin
  208. cliprt      dw xcenter+xmax-1   ; xcenter+xmax-1
  209. cliptp      dw ycenter+ymin     ; ycenter+ymin
  210. clipbt      dw ycenter+ymax-1   ; ycenter+ymax-1
  211.  
  212. xcent       dw xcenter
  213. ycent       dw ycenter
  214. ycents1     dw ycenter-1
  215. ycentp1     dw ycenter+1
  216.  
  217. xmaxxcent   dw xmax+xcenter
  218.  
  219. ymaxycent   dw ymax+ycenter
  220.  
  221. xmins       dw xmin
  222. xmins1      dw xmin-1
  223. xmaxs       dw xmax
  224. xmaxs1      dw xmax-1
  225.  
  226. ymins       dw ymin
  227. ymins1      dw ymin-1
  228. ymaxs       dw ymax
  229. ymaxs1      dw ymax-1
  230.  
  231. xmit        dd xmin-tolerance   ; tolerance is max object size/ratio
  232. xmat        dd xmax+tolerance
  233. ymit        dd ymin-tolerance
  234. ymat        dd ymax+tolerance
  235.  
  236. ; variables for icon scale routine
  237.  
  238. bitmap        dd ?
  239. destwidth     dw ?
  240. destheight    dw ?
  241. destx         dw ?
  242. desty         dw ?
  243.  
  244. sourcewidth   dw ?              ; workspace for icon scale routine
  245. sourceheight  dw ?
  246. decisionx     dw ?
  247. decisiony     dw ?
  248. clippedwidth  dw ?
  249. clippedheight dw ?
  250.  
  251. background dw 0                 ; background colour, must be in high and low!
  252.  
  253.            public xs
  254.            public ys
  255.            public zs
  256.            public xadds
  257.            public yadds
  258.            public zadds
  259.            public vxs
  260.            public vys
  261.            public vzs
  262.            public vxadds
  263.            public vyadds
  264.            public vzadds
  265.            public xsfinal
  266.            public ysfinal
  267.            public zsfinal
  268.            public vxsfinal
  269.            public vysfinal
  270.            public vzsfinal
  271.            public lcount
  272.            public acount
  273.            public whatshape
  274.            public userotate
  275.  
  276.            public eyex
  277.            public eyey
  278.            public eyez
  279.            public eyeax
  280.            public eyeay
  281.            public eyeaz
  282.            public eyexadds
  283.            public eyeyadds
  284.            public eyezadds
  285.            public eyevxadds
  286.            public eyevyadds
  287.            public eyevzadds
  288.            public eyefinalx
  289.            public eyefinaly
  290.            public eyefinalz
  291.            public eyefinalax
  292.            public eyefinalay
  293.            public eyefinalaz
  294.            public eyelcount
  295.            public eyeacount
  296.  
  297.            public onoff
  298.  
  299.            public vmatrix
  300.            public tmatrix
  301.            public ematrix
  302.            public lmatrix
  303.            public y_angle_of_sun
  304.  
  305.            public background
  306.  
  307.            public bitmap
  308.            public destwidth
  309.            public destheight
  310.            public destx
  311.            public desty
  312.  
  313.            public use_clear
  314.            public wfollow
  315.            public wherelook
  316.  
  317.            public x1
  318.            public y1
  319.            public x2
  320.            public y2
  321.            public colq
  322.            public steel
  323.  
  324.            public lxupdate
  325.            public lyupdate
  326.            public xupdate
  327.            public yupdate
  328.            public makeorder
  329.            public oney
  330.            public firstbyte
  331.            public lastbyte
  332.            public showing
  333.  
  334.            public xcent
  335.            public ycent
  336.            public xmins
  337.            public xmins1
  338.            public xmaxs
  339.            public xmaxs1
  340.            public ymins
  341.            public ymins1
  342.            public ymaxs
  343.            public ymaxs1
  344.  
  345.            public asm_maxpoints
  346.            public asm_maxsurfaces
  347.            public asm_maxpolys
  348.            public asm_maxobjects
  349.            public asm_number_spaces
  350.            public asm_xsize
  351.            public asm_ysize
  352.            public asm_usez
  353.            public asm_useborders
  354.            public asm_use_half_stars
  355.            public asm_cameraobject
  356.            public asm_xmode
  357.            public asm_ratiox
  358.            public asm_ratioy
  359.            public asm_xactual
  360.            public asm_yactual
  361.            public asm_pages
  362.  
  363.